package zlatan_demo02_constructor

object ClassDemo02 {

  class Customer(val name:String="",val address:String=""){

    def this(arr:Array[String]){

      //辅助构造器第一行代码必须访问主构造器或其他辅助构造器
      this(arr(0),arr(1))
    }
  }


  def main(args: Array[String]): Unit = {
     val c= new Customer(Array("张三","北京"))
     // val c2=new Customer("李四","上海")

    println(c.name,c.address)
    }


}
